/**
 */
package gatperdut.chato.model.Chato.Container.impl;

import gatperdut.chato.model.Chato.Container.BotContainer;
import gatperdut.chato.model.Chato.Container.ContainerPackage;

import gatperdut.chato.model.Chato.Entity.NPC;

import java.util.Collection;

import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.util.InternalEList;

import org.eclipse.emf.internal.cdo.CDOObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Bot Container</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link gatperdut.chato.model.Chato.Container.impl.BotContainerImpl#getBots <em>Bots</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class BotContainerImpl extends CDOObjectImpl implements BotContainer {
	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	protected BotContainerImpl() {
        super();
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	protected EClass eStaticClass() {
        return ContainerPackage.Literals.BOT_CONTAINER;
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	protected int eStaticFeatureCount() {
        return 0;
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@SuppressWarnings("unchecked")
	public EList<NPC> getBots() {
        return (EList<NPC>)eDynamicGet(ContainerPackage.BOT_CONTAINER__BOTS, ContainerPackage.Literals.BOT_CONTAINER__BOTS, true, true);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
        switch (featureID) {
            case ContainerPackage.BOT_CONTAINER__BOTS:
                return ((InternalEList<?>)getBots()).basicRemove(otherEnd, msgs);
        }
        return super.eInverseRemove(otherEnd, featureID, msgs);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
        switch (featureID) {
            case ContainerPackage.BOT_CONTAINER__BOTS:
                return getBots();
        }
        return super.eGet(featureID, resolve, coreType);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
        switch (featureID) {
            case ContainerPackage.BOT_CONTAINER__BOTS:
                getBots().clear();
                getBots().addAll((Collection<? extends NPC>)newValue);
                return;
        }
        super.eSet(featureID, newValue);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public void eUnset(int featureID) {
        switch (featureID) {
            case ContainerPackage.BOT_CONTAINER__BOTS:
                getBots().clear();
                return;
        }
        super.eUnset(featureID);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public boolean eIsSet(int featureID) {
        switch (featureID) {
            case ContainerPackage.BOT_CONTAINER__BOTS:
                return !getBots().isEmpty();
        }
        return super.eIsSet(featureID);
    }

} //BotContainerImpl
